#include <iostream>
#include <vector>
using namespace std;

class Solution
{
public:
    void DFS(vector<int>& A, vector<int>& B, vector<int>& C, size_t num)
    {
        if (num == 1)
        {
            C.push_back(A.back());
            A.pop_back();
            return;
        }
        DFS(A, C, B, num - 1);
        C.push_back(A.back());
        A.pop_back();
        DFS(B, A, C, num - 1);
    }
    void hanota(vector<int>& A, vector<int>& B, vector<int>& C)
    {
        DFS(A, B, C, A.size());
    }
};

int main()
{
    vector<int> A = { 2, 1, 1 };
    vector<int> B;
    vector<int> C;
    Solution().hanota(A, B, C);

    return 0;
}